package conf

//excludeExtensionMap exclude directory map
var excludeDirectoryMap map[string]interface{}

//excludeExtensionMap exclude file map
var excludeExtensionMap map[string]interface{}

//InitExclude init exclude file map
func InitExclude(excludeDirectoryList []string, fileExtensionList []string) {
	excludeDirectoryMap = make(map[string]interface{})
	for _, extension := range excludeDirectoryList {
		excludeDirectoryMap[extension] = struct{}{}
	}

	excludeExtensionMap = make(map[string]interface{})
	for _, extension := range fileExtensionList {
		excludeExtensionMap[extension] = struct{}{}
	}
}

//IsExcludeDirectory return ture if directory in exclude directory map
func IsExcludeDirectory(extension string) bool {
	_, ok := excludeDirectoryMap[extension]
	return ok
}

//IsExcludeFile return ture if extension in exclude file map
func IsExcludeFile(extension string) bool {
	_, ok := excludeExtensionMap[extension]
	return ok
}
